
/**
 * @author ypz
 * @date 2021/10/25 18:27
 */
public class SingletonDemo {
    private volatile static SingletonDemo singletonInstance;
    private SingletonDemo(){}
    public static  SingletonDemo getSingletonDemo() {
        if (singletonInstance == null){
            synchronized (SingletonDemo.class){
                if (singletonInstance == null){
                    singletonInstance = new SingletonDemo();
                }
            }
        }
        return singletonInstance;
    }

}
